<template>
	<view class="u-p-t-30">
		<view class="mdx-center-sm big_box">
			<u-gap></u-gap>
			<view class="u-text-center">
				<u-circle-progress active-color="#00A29A" :percent="resultInfo.fractions||0" width='240'>
					<view class="u-progress-content">
						<view class='fenshu'><text
								style="font-size: 45rpx;color: #00A29A;">{{resultInfo.fractions||'0'}}</text><text
								class="u-m-l-5">分</text></view>
						<view class='fNum_title'>本次得分</view>
					</view>
				</u-circle-progress>
			</view>
			<view class="correct u-m-t-30 u-text-center">
				正确率{{resultInfo.correctrate||'0'}}%
			</view>
			<view class="userTime u-text-center">
				{{resultInfo.timenum||'1'}}分钟
			</view>
			<u-gap height="40"></u-gap>
			<view class="u-flex jinduBox">
				<view>答对题数</view>
				<view class="left_text">
					{{resultInfo.rightNum||0}}
				</view>
				<view class="u-flex-1 u-m-t-5">
					<u-line-progress active-color="#00A29A" :percent="(resultInfo.rightNum/resultInfo.totalnum)*100"
						:show-percent='false'></u-line-progress>
				</view>
				<view class="right_text">
					{{resultInfo.totalnum||0}}
				</view>
			</view>
			<view class="u-flex jinduBox">
				<view>答错题数</view>
				<view class="left_text">
					{{resultInfo.wrongNum||0}}
				</view>
				<view class="u-flex-1 u-m-t-5">
					<u-line-progress active-color="#00A29A" :percent="(resultInfo.wrongNum/resultInfo.totalnum)*100"
						:show-percent='false'></u-line-progress>
				</view>
				<view class="right_text">
					{{resultInfo.totalnum||0}}
				</view>

			</view>
			<view class="u-text-center u-m-t-50" style="color: #999;">
				成绩还不错，但是仍有提升空间哦！快去系统学习成为更优秀的自己！
			</view>
		</view>
		<view class="mdx-center-sm u-m-t-80">


			<u-button :custom-style="customNone" :hair-line='false' @click="toWrong">查看试卷
			</u-button>
		</view>
		<view class="mdx-center-sm u-m-t-30">
			<u-button :custom-style="customStyle" :hair-line='false' @click="starStydt">开始学习
			</u-button>
		</view>
	</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				customNone: {
					color: '#00A29A',
					border: '1px solid #00A29A'
				},
				customStyle: {
					color: '#fff',
					background: '#00A29A'
				},
				resultInfo: {}
			}
		},
		onLoad() {
			uni.showLoading({
				title: '加载中...',
				mask: true
			})
			uni.getStorage({
				key: 'results',
				success: (e) => {
					this.resultInfo = e.data
				},
				complete() {
					uni.hideLoading()
				}
			})
		},
		onShow() {
			uni.hideHomeButton()
		},
		methods: {
			toWrong() {
				this.$mHelper.to('pages/examine/textWrong?postId=' + this.resultInfo.postid)
				
			},
			starStydt() {
				uni.reLaunch({
					url: '/pages/study/study'
				})
			}
		}
	}
</script>

<style lang="scss">
	.big_box {
		box-shadow: 0 0 10rpx #ddd;
		padding: 30rpx;
		border-radius: 15rpx;
	}

	.fenshu {
		font-size: 28rpx;
		color: #666;
	}

	.fNum_title {
		margin-top: 8rpx;
		color: #999;
	}

	.correct {
		font-size: 32rpx;
		color: #555;
	}

	.userTime {
		margin: 15rpx;
		color: #999;

	}

	.jinduBox {
		margin-top: 35rpx;

		.left_text {
			color: #00A29A;
			margin: 0 10rpx 0 20rpx;
		}

		.right_text {
			margin-left: 10rpx;
		}
	}
</style>
